package com.b1t.springcloud.controller;

import com.b1t.springcloud.domain.CommonResult;
import com.b1t.springcloud.domain.Order;
import com.b1t.springcloud.service.OrderService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/api")
public class OrderController {

    @Resource
    private OrderService orderService;

    /**
     * 创建订单
     */

    @GetMapping("/order/create")
    public CommonResult create(Order order)
    {
        orderService.create(order);
        return new CommonResult(200,"订单创建成功");
    }

    @GetMapping("/order/info")
    public String create()
    {
        return "1";
    }

}
